home *** CD-ROM | disk | FTP | other *** search
/ CD Classic 39 / CD CLASSIC #39 (1998).iso / EMPRESA / visio / Vistdstd / Install / Data.Z / FrmConfig.FRM < prev    next >
Text File  |  1997-06-26  |  11KB  |  321 lines

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.1#0"; "COMCTL32.OCX"
  3. Begin VB.Form frmConfig 
  4.    Caption         =   "Current Configuration"
  5.    ClientHeight    =   6555
  6.    ClientLeft      =   2115
  7.    ClientTop       =   915
  8.    ClientWidth     =   2370
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    OLEDropMode     =   1  'Manual
  13.    ScaleHeight     =   6555
  14.    ScaleWidth      =   2370
  15.    Begin ComctlLib.Toolbar Toolbar1 
  16.       Align           =   1  'Align Top
  17.       Height          =   420
  18.       Left            =   0
  19.       TabIndex        =   4
  20.       Top             =   0
  21.       Width           =   2370
  22.       _ExtentX        =   4180
  23.       _ExtentY        =   741
  24.       ButtonWidth     =   609
  25.       ButtonHeight    =   582
  26.       Appearance      =   1
  27.       ImageList       =   "ImageList1"
  28.       _Version        =   327680
  29.       BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7} 
  30.          NumButtons      =   1
  31.          BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  32.             Key             =   "Rollup"
  33.             Object.Tag             =   ""
  34.             ImageIndex      =   1
  35.             Style           =   1
  36.          EndProperty
  37.       EndProperty
  38.       MouseIcon       =   "frmConfig.frx":0000
  39.    End
  40.    Begin ComctlLib.TreeView TreeView1 
  41.       Height          =   2772
  42.       Left            =   0
  43.       TabIndex        =   0
  44.       Top             =   360
  45.       Width           =   2292
  46.       _ExtentX        =   4048
  47.       _ExtentY        =   4895
  48.       _Version        =   327680
  49.       HideSelection   =   0   'False
  50.       Indentation     =   176
  51.       LabelEdit       =   1
  52.       LineStyle       =   1
  53.       Style           =   7
  54.       ImageList       =   "ImageList1"
  55.       Appearance      =   1
  56.       MouseIcon       =   "frmConfig.frx":001C
  57.       OLEDragMode     =   1
  58.    End
  59.    Begin VB.PictureBox picSplitter 
  60.       BackColor       =   &H00808080&
  61.       BorderStyle     =   0  'None
  62.       FillColor       =   &H00808080&
  63.       Height          =   50
  64.       Left            =   -480
  65.       ScaleHeight     =   20.848
  66.       ScaleMode       =   0  'User
  67.       ScaleWidth      =   29328
  68.       TabIndex        =   3
  69.       Top             =   6000
  70.       Visible         =   0   'False
  71.       Width           =   4512
  72.    End
  73.    Begin ComctlLib.StatusBar StatusBar1 
  74.       Align           =   2  'Align Bottom
  75.       Height          =   360
  76.       Left            =   0
  77.       TabIndex        =   2
  78.       Top             =   6195
  79.       Width           =   2370
  80.       _ExtentX        =   4180
  81.       _ExtentY        =   635
  82.       SimpleText      =   "None"
  83.       _Version        =   327680
  84.       BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7} 
  85.          NumPanels       =   2
  86.          BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  87.             AutoSize        =   2
  88.             Object.Width           =   1773
  89.             MinWidth        =   1764
  90.             TextSave        =   ""
  91.             Key             =   ""
  92.             Object.Tag             =   ""
  93.          EndProperty
  94.          BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  95.             TextSave        =   ""
  96.             Key             =   ""
  97.             Object.Tag             =   ""
  98.          EndProperty
  99.       EndProperty
  100.       MouseIcon       =   "frmConfig.frx":0038
  101.       OLEDropMode     =   1
  102.    End
  103.    Begin ComctlLib.ListView ListView1 
  104.       Height          =   1812
  105.       Left            =   0
  106.       TabIndex        =   1
  107.       Top             =   3240
  108.       Width           =   2292
  109.       _ExtentX        =   4048
  110.       _ExtentY        =   3201
  111.       View            =   3
  112.       LabelEdit       =   1
  113.       LabelWrap       =   -1  'True
  114.       HideSelection   =   0   'False
  115.       _Version        =   327680
  116.       ForeColor       =   -2147483640
  117.       BackColor       =   -2147483643
  118.       BorderStyle     =   1
  119.       Appearance      =   1
  120.       MouseIcon       =   "frmConfig.frx":0054
  121.       NumItems        =   2
  122.       BeginProperty ColumnHeader(1) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  123.          Key             =   "Prop"
  124.          Object.Tag             =   ""
  125.          Text            =   "Property"
  126.          Object.Width           =   1764
  127.       EndProperty
  128.       BeginProperty ColumnHeader(2) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  129.          SubItemIndex    =   1
  130.          Key             =   "Value"
  131.          Object.Tag             =   ""
  132.          Text            =   "Value"
  133.          Object.Width           =   2540
  134.       EndProperty
  135.    End
  136.    Begin VB.Image imgSplitter 
  137.       Height          =   50
  138.       Left            =   0
  139.       MousePointer    =   7  'Size N S
  140.       Top             =   3120
  141.       Width           =   3516
  142.    End
  143.    Begin ComctlLib.ImageList ImageList1 
  144.       Left            =   1320
  145.       Top             =   5160
  146.       _ExtentX        =   794
  147.       _ExtentY        =   794
  148.       BackColor       =   -2147483643
  149.       ImageWidth      =   16
  150.       ImageHeight     =   16
  151.       MaskColor       =   12632256
  152.       _Version        =   327680
  153.       BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} 
  154.          NumListImages   =   7
  155.          BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  156.             Picture         =   "frmConfig.frx":0070
  157.             Key             =   "Up"
  158.          EndProperty
  159.          BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  160.             Picture         =   "frmConfig.frx":038A
  161.             Key             =   "Open"
  162.          EndProperty
  163.          BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  164.             Picture         =   "frmConfig.frx":06A4
  165.             Key             =   "Close"
  166.          EndProperty
  167.          BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  168.             Picture         =   "frmConfig.frx":09BE
  169.             Key             =   "Hutch"
  170.          EndProperty
  171.          BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  172.             Picture         =   "frmConfig.frx":0CD8
  173.             Key             =   "DoorChest"
  174.          EndProperty
  175.          BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  176.             Picture         =   "frmConfig.frx":0FF2
  177.             Key             =   "Dresser"
  178.          EndProperty
  179.          BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  180.             Picture         =   "frmConfig.frx":130C
  181.             Key             =   "Desk"
  182.          EndProperty
  183.       EndProperty
  184.    End
  185. End
  186. Attribute VB_Name = "frmConfig"
  187. Attribute VB_GlobalNameSpace = False
  188. Attribute VB_Creatable = False
  189. Attribute VB_PredeclaredId = True
  190. Attribute VB_Exposed = False
  191. ' -----------------------------------------------------------------------------
  192. ' Copyright (C) 1997 Visio Corporation. All rights reserved.
  193. '
  194. ' You have a royalty-free right to use, modify, reproduce and distribute
  195. ' the Sample Application Files (and/or any modified version) in any way
  196. ' you find useful, provided that you agree that Visio has no warranty,
  197. ' obligations or liability for any Sample Application Files.
  198. ' -----------------------------------------------------------------------------
  199. Option Explicit
  200. ' SetWindowPos() hwndInsertAfter values
  201. Const HWND_TOPMOST = -1
  202. ' SetWindowPos Flags
  203. Const SWP_NOSIZE = &H1
  204. Const SWP_NOMOVE = &H2
  205.  
  206. Public tvcProduct As ProductView
  207. Dim mbMoving As Boolean
  208. Dim oldHeight As Single
  209. Dim hidden As Boolean
  210. Const sglSplitLimit = 1000
  211.  
  212. Private Sub Form_load()
  213.     Dim ret As Long
  214.     Dim flags As Long
  215.     
  216.     'Force the form window to always remain on top
  217.     flags = SWP_NOSIZE Or SWP_NOMOVE
  218.     ret = SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, flags)
  219. End Sub
  220.  
  221. Private Sub Form_Resize()
  222. 'Resize the form
  223.     On Error Resume Next
  224.     
  225.     If Not hidden Then
  226.         If Me.Height < 2500 Then Me.Height = 2500
  227.         SizeControls imgSplitter.Top
  228.     End If
  229. End Sub
  230.  
  231. Private Sub Form_Unload(Cancel As Integer)
  232.     Unload Me
  233. End Sub
  234.  
  235. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  236. 'The form window shows two lists, the list of objects and a
  237. 'selected objects properties list. The portion of the form used
  238. 'by each list can be modified by moving the imgSplitter. By detecting
  239. 'MouseDown, MouseMove, and MouseUp events the size of the two lists
  240. 'can be modified together and controlled by the position of the
  241. 'imgSplitter.
  242.     With imgSplitter
  243.         picSplitter.Move .Left, .Top, .Width, .Height
  244.     End With
  245.     picSplitter.Visible = True
  246.     mbMoving = True
  247. End Sub
  248.  
  249. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  250. 'See MouseDown
  251.     Dim sglPos As Single
  252.     
  253.     If mbMoving Then
  254.         sglPos = y + imgSplitter.Top
  255.         If sglPos < sglSplitLimit Then
  256.             picSplitter.Top = sglSplitLimit
  257.         ElseIf sglPos > Height - sglSplitLimit Then
  258.             picSplitter.Top = Height - sglSplitLimit
  259.         Else
  260.             picSplitter.Top = sglPos
  261.         End If
  262.     End If
  263. End Sub
  264.  
  265. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  266. 'See MouseDown
  267.     SizeControls picSplitter.Top
  268.     picSplitter.Visible = False
  269.     mbMoving = False
  270. End Sub
  271.  
  272.  
  273. Sub SizeControls(y As Single)
  274. 'Called on form resizing
  275.     On Error Resume Next
  276.     
  277. If Not hidden Then
  278.     'set the Height
  279.     Toolbar1.Width = Me.ScaleWidth
  280.     
  281.     imgSplitter.Width = Me.ScaleWidth
  282.     imgSplitter.Top = y
  283.     
  284.     With TreeView1
  285.         .Top = Toolbar1.Height
  286.         .Width = Me.ScaleWidth
  287.         .Height = y - Toolbar1.Height
  288.     End With
  289.     
  290.     With ListView1
  291.         .Top = y + imgSplitter.Height
  292.         .Width = Me.ScaleWidth
  293.         .Height = Me.ScaleHeight - .Top - StatusBar1.Height
  294.     End With
  295. End If
  296. End Sub
  297.  
  298. Private Sub Toolbar1_ButtonClick(ByVal Button As ComctlLib.Button)
  299. 'Minimize the form selecting the toolbar button
  300.     Select Case Button.Key
  301.     
  302.         Case "Rollup"
  303.             If Button.Value = tbrPressed Then
  304.                 oldHeight = frmConfig.Height
  305.                 hidden = True
  306.                 frmConfig.Height = (frmConfig.Height - frmConfig.ScaleHeight) + Toolbar1.Height
  307.              Else
  308.                 hidden = False
  309.                 frmConfig.Height = oldHeight
  310.                 Call Form_Resize
  311.             End If
  312.         Case Else
  313.     End Select
  314.     
  315. End Sub
  316.  
  317. Private Sub TreeView1_Click()
  318. 'The user has selected an item from the list
  319.     tvcProduct.ClickedOnNode TreeView1.SelectedItem.Key
  320. End Sub
  321.